package tt.lab.pmbok.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;

import org.codehaus.jackson.annotate.JsonIgnore;

public class Tool{
	private int id;
	private String name;
	private String description;
	private Set<ProcessTool> processes;
	
	public String toString(){
		return "Tool#"+id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	
	public void setProcesses(Set<ProcessTool> processes) {
		this.processes = processes;
	}
	
	public Set<ProcessTool> getProcesses() {
		return processes;
	}
	
	public List<ProcessTool> getSortedProcesses() {
		List<ProcessTool> list = new ArrayList<ProcessTool>();
		for (ProcessTool tool : getProcesses()) {
			list.add(tool);
		}
		Collections.sort(list);
		return list;
	}
}
